<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model backend\models\Goods */

$this->title                   = $model->title;
$this->params['breadcrumbs'][] = ['label' => 'Goods', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="goods-view">

    <h1><?= Html::encode($this->title) ?></h1>

    <?= DetailView::widget([
        'model'      => $model,
        'attributes' => [
            'id',
            'status',
            'type',
//            'img',
            [
                'attribute' => 'right',
                'value'     => function ($model) {
                    /** @var \common\models\Goods $model */
                    return $model->right0->item_name;
                }
            ],
            'title',
            'code',
            'description',
            'color',
            'price',
            'availability_period',
            'availability_num',
            'created_at:datetime',
            'updated_at:datetime',
        ],
    ]) ?>

</div>
